MSVC++ vs g++

 

This is a short discussion about salient differences between the Microsoft Visual C++ 6.0 compiler and the g++ compiler as it pertains to this course.


1)  You should always use the new C++ files in the MSVC++ compiler. That means:

	#include <iostream>
	using namespace std;
Instead of:
	#include <iostream.h>
The former is the correct style but it is not used in all iCarnegie examples.

 


 

2)  In many instances, iCarnegie has chosen the following initilization for pointer variables:

	Node *x(head); // head is a Node pointer variable.
The reason for using such an initilization in a constructor is that a copy of objects does not have to be made. The folks at iCarnegie do not seem to realize this and are blindly applying this to all initilizations. However, the fix is easy. Change to:
	Node (*x)(head); 
or
	Node *x = head;
The latter always works, the former works in most cases.

 


3) Future updates.